const express = require('express')
const router = express.Router()
const jsonController = require('../controllers/jsonController')
const formatController = require('../controllers/formatController')
const runController = require('../controllers/runController')
const stringController = require('../controllers/stringController')
const encodeController = require('../controllers/encodeController')

router.use('/json', jsonController)
router.use('/format', formatController)
router.use('/run', runController)
router.use('/string', stringController)
router.use('/encode', encodeController)

// 添加一个默认路由，用于处理未匹配的路由
router.use('*', (req, res) => {
  res.status(404).json({ message: 'Not Found' })
})

module.exports = router